
  CREATE TABLE "MAPADMIN"."PUBLICHOLIDAY" 
   (	"PH_DATE" DATE NOT NULL ENABLE, 
	"RH_REMARK" VARCHAR2(100 BYTE), 
	 CONSTRAINT "PUBLICHOLIDAY_PK" PRIMARY KEY ("PH_DATE")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
  
  
create or replace TRIGGER "MAPADMIN"."TRIGGER_CASEMAST_INS" 
BEFORE INSERT ON CASEMAST FOR EACH ROW
DECLARE
  caseID CASEMAST.C_ID%TYPE;
  
BEGIN

  select SEQ_CASEMAST.nextval into caseID from dual;  
  :NEW.C_ID := caseID;

  if to_char(sysdate, 'HH24') >= 14 then
	:NEW.C_CREATED_DATE2 := trunc(sysdate + 1);
  else
   :NEW.C_CREATED_DATE2 := sysdate;
  end if;
END;